<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>欢迎页面-L-admin1.0</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="../css/font.css">
<link rel="stylesheet" href="../css/xadmin.css">
<script src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../lib/layui/layui.js"
	charset="utf-8"></script>
<script type="text/javascript" src="../js/xadmin.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<script type="text/javascript">
var $claimForm;
var rowNumber=0;
var totalAcount=0;


       function submitClaimVoucher(action) {
		if(!confirm("确定"+action+"报销单吗")) return;
		if(action == "保存"){
			$claimForm.find("#status").val("1");//新创建
		}else{
			#claimForm.find("#status").val("2");//已提交
		}
		#claimForm.submit();
	  }
    </script>

</head>

<body>
	<div class="x-body">
		<form class="layui-form" action="claimVoucher.action" method="post" id="claimForm">
			<table class="layui-table">
				<tbody>
					<tr>
						<td>*填报人:</td>
						<td><s:property value="#session.employee.name" /></td>
						<td>*填报时间</td>
						<td><s:date name="new java.util.Date()"
								format="yyyy-MM-dd HH:mm:ss" /></td>
					</tr>
					<tr>
						<td>*总金额 ￥</td>
						<td><input type="text" name="claimVoucher.totalAccount"
							value="0.0" /></td>
						<td>*状态</td>
						<td>新创建<input type="hidden" name="claimVoucher.status"
							id="status" value="" /></td>
					</tr>
					<tr>
						<td colspan="4"><span class="" id="notice"></span></td>
					</tr>
				</tbody>
			</table>

			<table id="myTable" class="layui-table" layui-form-item>
				<tbody>
					<tr>
						<td width="30%">项目类别</td>
						<td width="30%">项目金额</td>
						<td width="30%">费用说明</td>
						<td width="10%">操作</td>
					</tr>
				</tbody>
			</table>

			<table id="detailTable" class="layui-table" layui-form-item>
				<tr>
					<td width="35%"><select name="claimVoucherDetail.item"
						id="item">
							<option value="城际交通费">城际交通费</option>
							<option value="室内交通费">室内交通费</option>
							<option value="通讯费">通讯费</option>
							<option value="礼品费">礼品费</option>
							<option value="办公费">办公费</option>
							<option value="交际餐费费">交际餐费费</option>
							<option value="餐补">餐补</option>
							<option value="住宿费">住宿费</option>
					</select></td>
					<td width="30%"><input type="text"
						name="claimVoucherDetail.account" id="account" /></td>
					<td width="30%"><input type="text"
						name="claimVoucherDetail.desc" id="desc" /></td>
					<td width="10%"><input src="${images}/add.gif" 
					id="AddRow" /></td>
						<!-- <td width="10%"><input src="${images}/add.gif" width="16"
						height="16" id="AddRow" /></td> -->
				</tr>

			</table>
             
             <table>
               <tr>
                 <td>*事由:<br/> <span class="notice" id="eventNotice"/></td>
                  <td><textare><textarea rows="5" cols="66" name="claimVoucher.event" id="event"></textarea></td>
               </tr>
             <tr>
               <td>
               </td>
               <td>
                 <input type="button" id="1" name="1" value="保存" onclick="submitClaimVoucher('保存')" class="submit_01">
                  <input type="button" id="2" name="2" value="提交" onclick="submitClaimVoucher('提交')" class="submit_01">
               </td>
             </tr>
             </table>



		
		</form>
	</div>
	<script>
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer;
        
          //自定义验证规则
          form.verify({
            nikename: function(value){
              if(value.length < 5){
                return '昵称至少得5个字符啊';
              }
            }
            ,pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,repass: function(value){
                if($('#L_pass').val()!=$('#L_repass').val()){
                    return '两次密码不一致';
                }
            }
          });

          //监听提交
          form.on('submit(add)', function(data){
            console.log(data);
            //发异步，把数据提交给php
            layer.alert("增加成功", {icon: 6},function () {
                // 获得frame索引
                var index = parent.layer.getFrameIndex(window.name);
                //关闭当前frame
                parent.layer.close(index);
            });
            return false;
          });
        });
    </script>
</body>

</html>